import request from '../utils/request'
import config from '../config'

/*
 * 预约接口
 * @author： 黄
 */

/*
 * @desc 提交预约订单数据
 * @param {object} order 订单信息
 * @return {promise}
 */
async function postAppointmentOrder (order) {
  return request(config.apiList.postAppointmentOrder, order, 'post')
}

/*
 * @desc 获取单个订单信息
 * @param {number} id 订单id
 * @return {promise}
 */
async function getAppointmentOrder (id) {
  return request(config.apiList.getAppointmentOrder, {id: id})
}

/*
 * @desc 获取员工某一天的剩余时间点
 * @param {object} filter 查询数据
 * @return {promise}
 */
async function getUserDayLeftPoint (filter) {
  return request(config.apiList.getUserDayLeftPoint, filter)
}

export {
  postAppointmentOrder,
  getAppointmentOrder,
  getUserDayLeftPoint
 }
